package com.github.shiqiyue.blog.markdown.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;

import lombok.Data;

/***
 * 文章
 * 
 * @author wwy
 *
 */
@Data
@Entity(name = "blog_article")
public class Article implements Serializable {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 7591975571056741529L;
	
	/***
	 * id
	 */
	@Id
	@GeneratedValue
	private Long id;
	
	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "user_id")
	private User user;
	
	/***
	 * 标题
	 */
	private String title;
	
	/***
	 * 简介
	 */
	private String brief;
	
	/***
	 * 内容
	 */
	private String content;
	
	/***
	 * 添加时间
	 */
	@Column(name = "add_date")
	private Date addDate;
	
	@Column(name = "edit_date")
	private Date editDate;
	
}
